package leetcode.tree;

import leetcode.tree.common.TreeNode;
import leetcode.tree.common.TreeUtils;

/**
 * Definition for a binary tree node.
 * public class TreeNode {
 * int val;
 * TreeNode left;
 * TreeNode right;
 * TreeNode() {}
 * TreeNode(int val) { this.val = val; }
 * TreeNode(int val, TreeNode left, TreeNode right) {
 * this.val = val;
 * this.left = left;
 * this.right = right;
 * }
 * }
 */
class Solution606 {
    public String tree2str(TreeNode root) {
        return TreeUtils.tree2str(root);
    }
}

public class leetcode606 {
    public static void main(String[] args) {
        Solution606 solution606 = new Solution606();
        Integer[] nums = {1, 2, 3, 4};
        Integer[] nums1 = {1, 2, 3, null, 4};
        System.out.println(solution606.tree2str(TreeUtils.generateLeetcodeTree(nums)));
        System.out.println(solution606.tree2str(TreeUtils.generateLeetcodeTree(nums1)));
    }
}
